package jp.java.test1.pkg20_29.test29;

public class Main {

	public static void main(String[] args) {
//		Outer.Inner i1 = new Outer.Inner();
//		Outer.Inner i2 = new Outer.Inner();
//		Outer.Inner i3 = new Outer.Inner();
		Outer.Inner i1 = new Outer().getInner();
		Outer.Inner i2 = new Outer().getInner();
		Outer.Inner i3 = new Outer().getInner();
		System.out.println(i3.getCount());
	}

}

class Outer {
	static class Inner {
		private int count;
		public Inner() {
			count ++;
		}
		public int getCount() {
			return this.count;
		}
	}
	
	public Inner getInner(){
		return new Inner();
	}
}